<?php
declare(strict_types=1);

namespace App\Resource\Group\Party;


use Illuminate\Http\Resources\Json\JsonResource;

class MemberResource extends JsonResource
{
    public function toArray($request)
    {
        if(empty($this->id)){
            return [];
        }
        return [
            "id" => $this->id,
            "role" => $this->role,
            "user" => UserResource::make($this->user),
        ];
    }
}